// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.utils;

import org.springframework.context.ApplicationEvent;

import java.net.Inet4Address;
import java.net.UnknownHostException;
import java.net.InetAddress;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;

@Component
public class SwaggerPrintConfig implements ApplicationListener<WebServerInitializedEvent> {
    private final Logger log = LoggerFactory.getLogger(this.getClass());

    public SwaggerPrintConfig() {
    }

    public void onApplicationEvent(WebServerInitializedEvent event) {
        try {
            String hostAddress = Inet4Address.getLocalHost().getHostAddress();
            int port = event.getWebServer().getPort();
            String applicationName = event.getApplicationContext().getApplicationName();
            this.log.info("项目启动启动成功！接口文档地址: http://" + hostAddress + ":" + event.getWebServer().getPort() + applicationName + "/swagger-ui.html");
        } catch (UnknownHostException var5) {
            var5.printStackTrace();
        }

    }
}
